package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description:
 * @author: 付益民
 * @create: 2020-09-22-19:38
 */
@Repository
public interface AccountDao {
     @Insert("insert into account values(null,#{name},#{money})")
     int saveAccount(Account account);

     @Delete("delete from account where id=#{id}")
     int deleteAccount(String id);

     @Update("update account set name=#{name},money=#{money} where id=#{id}")
     int updateAccount(Account account);

     @Select("select * from account")
     List<Account> findAll();
}
